package com.avic.modules.statistics.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author zhangzikang 设备运行看板统计表
 * @date 2022-08-14
 */
@Data
@TableName("kanban_statistics")
public class KanbanStatistics implements Serializable {

    /** ID */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /** 设备运行数量 */
    private Integer runningQuantity;

    /** 设备关机数量 */
    private Integer shutdownQuantity;

    /** 设备id */
    private String equipId;

    /** 设备运行时间 */
    private Long runningTime;

    /** 设备关机时间 */
    private Long shutdownTime;


    /** 创建时间 */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;

    public void copy(KanbanStatistics source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
